package com.jcgyl.export.service.Impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jcgyl.export.dao.TbreceiptDao;
import com.jcgyl.export.dao.TbwaybillDao;
import com.jcgyl.export.entity.Tbreceipt;
import com.jcgyl.export.entity.Tbwaybill;
import com.jcgyl.export.service.WaybillService;

@Service
public class WaybillServiceImpl implements WaybillService {

	@Autowired
	private TbwaybillDao tbwaybillDao;
	@Autowired
	private TbreceiptDao tbreceiptDao;

	@Override
	public List<Tbwaybill> findObject(String orderid, String batchnumber, String expressnumber,
			String Starttime,String Endtime, int pageSize, int pageCount) {
		int startIndex = (pageCount - 1) * pageSize;
		List<Tbwaybill> list = tbwaybillDao.findObject(orderid, batchnumber, expressnumber, Starttime, Endtime, startIndex, pageSize);
		return list;
	}

	@Override
	public Integer getRowCount(String orderid, String batchnumber, String expressnumber, String Starttime,String Endtime) {
		
		int row = tbwaybillDao.getRowCount(orderid, batchnumber, expressnumber, Starttime, Endtime);
		return row;
	}

	@Override
	public void batchInsert(List<Tbwaybill> waybills) {
		// TODO Auto-generated method stub
		tbwaybillDao.batchInsert(waybills);
	}
	/**
	 * 修改运单信息
	 * JL
	 */
	@Override
	public Integer UpdataObject(Tbwaybill tbwaybill) {
		int row = tbwaybillDao.UpdateObject(tbwaybill);
		return row;
	}

	@Override
	public List<Tbreceipt> findReceipt(String receipttype, String expressnumber) {
		System.out.println(receipttype);
		System.out.println(expressnumber);
		List<Tbreceipt> list =tbreceiptDao.findObject(receipttype, expressnumber);
		return list;
	}

}
